package test;
class Shape {
	protected int id;
	protected String color;
	
	void area() {
	}
	void volume() {
	}
	Shape(int id,String color) {
		this.id=id;
		this.color=color;
	}
	Shape() {
	}
	public int getId() {
		return id;
	}
	public String getColor() {
		return color;
	}
	public void setId(int id) {
		this.id = id;
	}
	public void setColor(String color) {
		this.color = color;
	}
	
	
}

class Rectangle extends Shape {
	protected double width;
	protected double height;
	
	Rectangle(double width,double height) {
		
	}

	Rectangle(int id,String color,double width,double height) {
		super(id,color);
		this.id=id;
		this.color=color;
		this.width=width;
		this.height=height;
		
	}
	
	public void area() {
		System.out.println(width*height);
	}

	public double getWidth() {
		return width;
	}

	public double getHeight() {
		return height;
	}

	public void setWidth(double width) {
		this.width = width;
	}

	public void setHeight(double height) {
		this.height = height;
	}
	
	
}

class Cube extends Rectangle {
//	Cube(double width, double height) {
//		super(width, height);
//		// TODO Auto-generated constructor stub
//	}	
	
	private double side;
	private double density;
	
	Cube(double width,double height,double side,double density) {
		super(width,height);
		this.width=width;
		this.height=height;
		this.side=side;
		this.density=density;
	}
	
	Cube(int id,double width,double height,double side,double density,String color) {
		super(id,color,width,height);
		this.id=id;
		this.color=color;
		this.density=density;
		this.height=height;
		this.side=side;
		this.width=width;
	}

	public void area() {
		System.out.println(side*width*height);
	}
	
	public void volume() {
		System.out.println(side*width*height*density);
	}
	
	
	
}

public class test_2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Rectangle n1=new Rectangle(100,"Red",4.0,6.0);
		Cube n2=new Cube(2.0,3.0,7.0,3.1);
		n1.area();
		n2.area();
		n2.volume();
		
	}

}
